<?php
defined('IN_PHPCMS') or exit('No permission resources.');
//模型缓存路径
define('CACHE_MODEL_PATH',CACHE_PATH.'caches_model'.DIRECTORY_SEPARATOR.'caches_data'.DIRECTORY_SEPARATOR);
pc_base::load_app_func('util','content');
class index {
	private $db;
	function __construct() {
		$this->db = pc_base::load_model('bbss_model');
		/*
		$this->_userid = param::get_cookie('_userid');
		$this->_username = param::get_cookie('_username');
		$this->_groupid = param::get_cookie('_groupid');
		*/
	}
	//首页
	public function init() {
		if(isset($_POST['danwei'])){
		$data = array(
		'title' => $_POST['title'],
		'name' => $_POST['name'],
		'email' => $_POST['email'],
		'phone' => $_POST['phone'],
		'danwei' => $_POST['danwei'],
		'description' => $_POST['liuyan'],
		);
		$result = $this->db->insert('news',$data);
		if(!empty($result))
		{
			echo "出错了";
		}else
		{
			echo "sucess!";
		}
		}
		
	}
	
}
?>